<?php

namespace app\api\controller;

use app\common\controller\Api;
use app\api\service\OrderService;

class Order extends Api
{
    protected $noNeedLogin = [];
    protected $noNeedRight = '*';

    /**
     * 订单支付
     */
    public function pay()
    {
        $data = $this->request->post();
        $res = OrderService::orderPayment($data);
        return json($res);
    }

    // 技术电话
    public function phone()
    {
        $res = OrderService::getPhone();
        return json($res);
    }

    /**
     * 订单列表
     */
    public function lists()
    {
        $data = $this->request->post();
        $res = OrderService::getOrderLists($data);
        return json($res);
    }

    /**
     * 订单详情
     */
    public function details()
    {
        $data = $this->request->post();
        $res = OrderService::getOrderDetails($data);
        return json($res);
    }

    /**
     * 联系客服
     */
    public function service_phone()
    {
        $res = OrderService::getServicePhone();
        return json($res);
    }

    /**
     * 取消订单提示
     */
    public function cancel_tips()
    {
        $data = $this->request->post();
        $res = OrderService::getCancelTips($data);
        return json($res);
    }

    /**
     * 取消订单
     */
    public function cancel()
    {
        $data = $this->request->post();
        $res = OrderService::cancelOrder($data);
        return json($res);
    }

    /**
     * 完成订单
     */
    public function finish()
    {
        $data = $this->request->post();
        $res = OrderService::finishOrder($data);
        return json($res);
    }

    // 评价订单
    public function evaluate()
    {
        $data = $this->request->post();
        $res = OrderService::evaluateOrder($data);
        return json($res);
    }

    // 我的工单
    public function work_list()
    {
        $data = $this->request->post();
        $res = OrderService::getWorkList($data);
        return json($res);
    }

    /**
     * 修改预约时间
     */
    public function change_reservation_time()
    {
        $data = $this->request->post();
        $res = OrderService::changeReservationTime($data);
        return json($res);
    }















    
    /**
     * 订单回调
     */
    public function test_notifyx()
    {
        $data = $this->request->post();
        $res = OrderService::testNotifyx($data);
        return json($res);
    }

}